package com.anycl.design.behavioral.nullobject.instancetwo;

public class GoodsFactory {

    public static AbstractGoods find(final String isbn) {
        AbstractGoods result = null;
        switch(isbn) {
            case "001":
                result = new ConcreteGoods("001", "Java", 102.22);
                break;
            case "002":
                result = new ConcreteGoods("002", "MySQL", 82.22);
                break;
            default:
                result = new NullGoods();
        }
        return result;
    }
}
